<link type="text/css" href="/admins/js/pagerView/pager-view.css" rel="stylesheet" />
<link type="text/css" href="/admins/js/jquery/css/ui-lightness/jquery-ui-1.8.20.custom.css" rel="stylesheet" />
<script type="text/javascript" src="/admins/js/jquery/jquery-ui-1.8.20.custom.min.js"></script>
<script type="text/javascript" src="/admins/js/jquery/jquery.ui.datepicker-zh-CN.js"></script>
<script type="text/javascript" src="/admins/js/pagerView/pager-view.js"></script>
<script type="text/javascript">
$(function(){
    
	$.datepicker.setDefaults( $.datepicker.regional[ "zh-CN" ] );
        $( "#form1 #sel #starttime" ).datepicker();
	$( "#form1 #sel #endtime" ).datepicker();
});
</script>
<style>
	.datatable {
		text-align: left;
		font-size: 12px;
		font-family: verdana;
		background: #c0c0c0; margin:2px;
	}

	.datatable thead tr,

	.datatable tfoot tr {
		background: #c0c0c0;
	}

	.datatable tbody tr {
		background: #f0f0f0;
	}

	.datatable td, th {
		border: 1px solid white; height:28px;
	}
	.datatable td {background-color:white;}
	
	.datatable .hover td {background-color:#99CCFF;}
	
	.datatable .select td {background-color:#EEEE99;}

	#ui-datepicker-div{ font-size:12px;}
</style>

<div style="padding:2px; margin:2px;">
    <form action=""  method="get" style="margin:0px" id="form1">
        <div style=" border:1px solid #DDDDDD; padding:2px; margin:2px;line-height: 36px;" id='sel'> 
            <label for="name">用户名：</label><input type="text" id="username" name="username" value="<?php echo $this->nikename;?>"/>
            <label for="email">Email：</label><input type="text" id="email" name="email" value="<?php echo $this->email;?>"/>
            <label for="storeno">仓库号：</label><input type="text" id="storeno" name="storeno" value="<?php echo $this->storeno;?>" />
                <select id="dateselect" name="dateselect">
                  <option value="regedit" <?php if($this->dateselect=='regedit'){echo "selected";} ?>>注册时间</option>
                  <option value="login" <?php if($this->dateselect=='login'){echo "selected";} ?>>登录时间</option>
                </select>
            <label for="starttime">：</label><input type="text" id="starttime" name="starttime" value="<?php echo $this->starttime;?>" />
            <label for="endtime">-- </label><input type="text" id="endtime" name="endtime" value="<?php echo $this->endtime;?>"  />
            <input type="hidden" name="operate" id="operate" value="selectuser" />
            <input type="submit" id="queryButton" name="queryButton" value="查询"/>
        </div>
    </form>
    <table cellspacing="1" width="100%" class="datatable" id="waybill-table">
            <thead>
                    <tr >
                            <th></th>
                            <th>ID</th>
                            <th>用户名</th>
                            <th>email</th>
                            <th>注册时间</th>
                            <th>最后登录时间</th>
                            <th>用户类型</th>
                            <th>仓库地址</th>
                            <th>成长值</th>
                            <th>余额</th>
                            <th>最后登录IP</th>
                            <th>最后登录国家</th>
                    </tr>
            </thead>
        <tfoot>
          <tr><td colspan="14"></td></tr>
        </tfoot>
            <tbody>
                    <?php foreach ($this->useralllist as $Item) {?>
                        <?php 
//                                
                                $account = new Application_Model_UserAccount();
                                $accdetail = $account->getAccDetail($Item->id);
                        ?>
                        <tr>
                            <td ><input type="checkbox" value="<?php echo $Item->id;?>" class="checkbox-del" name='checkbox'  /></td>
                            <td><?php echo $Item->id;?></td>
                            <td><?php echo $Item->nikename;?></td>
                            <td><?php echo $Item->email;?></td>
                            <td><?php echo $Item->datecreated;?></td>
                            <td><?php echo $Item->lastLogin;?></td>
                            <td><?php echo $Item->userType;?></td>
                            <td><?php echo $Item->storeno;?></td>
                            <td><?php if($accdetail->score != ''){echo $accdetail->score;}else{echo 0;}?></td>
                            <td><?php if($accdetail->money != ''){echo $accdetail->money;}else{echo 0;}?></td>
                            <td><?php echo $Item->loginip;?></td>
                            <td><?php echo $Item->lastlogincountry;?></td>
                        </tr>
                    <?php }?>
            </tbody>
    </table>
    <?

       echo $this->partial('paging.phtml',array("pages"=>$this->userall));

   ?>
</div>
<script language="javascript">
    $('.Page a').unbind().click(function(){
        var href = $(this).attr('href');
        var formto = $('#form1').attr("action");
        if(formto.length>=0){
            $('#form1').attr("action", formto+href)
            $('#form1').submit();
            return false; 
        }else{
            return true;
        }
    });
</script>
